package com.longge;

import java.io.*;

public class Test {
    public static void main(String[] args) {

        try {
            FileInputStream fis = new FileInputStream("D:/A.txt");
            InputStreamReader isr = new InputStreamReader(fis);
            FileOutputStream fos = new FileOutputStream("D:/C.txt");
            OutputStreamWriter osw = new OutputStreamWriter(fos, "GB2312");
            int s;
            while ((s = isr.read()) != -1) {
                osw.write(s);
            }
            osw.flush();
            osw.close();
            isr.close();
            fis.close();
            System.out.println("写入完成！");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}